package com.yang.common;

import lombok.Data;

import java.io.Serializable;

@Data
public class ResponseResult implements Serializable {

    private static final long serialVersionUID = 1L;

    private String status;
    private String message;
    private Object data;

    public static ResponseResult successResult(Object data) {
        return new ResponseResult("200", "调用成功", data);
    }

    public static ResponseResult successResult() {
        return new ResponseResult("200", "调用成功", null);
    }

    public static ResponseResult failedResult(String message) {
        return new ResponseResult("400", message, null);
    }

    public static ResponseResult failedResult(String statusCode, String message) {
        return new ResponseResult(statusCode, message, null);
    }

    public ResponseResult() {
    }

    public ResponseResult(String status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

}
